package DemoText;

import java.util.Scanner;

/**
 * 好数
 */
public class LuoGuP10424 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int ret = 0;
        for (int i = 1; i <= n; i++) {
            if (isHaoShu(i)) ret++;
        }
        System.out.println(ret);
    }
    public static boolean isHaoShu (int n) {
        int i = 1;
        while (n > 0) {
            if (i % 2 == 1) {
                if ((n % 10) % 2 == 0) return false;
            } else {
                if ((n % 10) % 2 == 1) return false;
            }
            i++;
            n /= 10;
        }
        return true;
    }
}
